Skip to content

fix: PMAA-126 ticket#303

Merged
ruturaj-browserstack merged 1 commit into
browserstack:mainfrom
SavioBS629:PMAA-126_priority
May 28, 2026
Merged

fix: PMAA-126 ticket#303
ruturaj-browserstack merged 1 commit into
browserstack:mainfrom
SavioBS629:PMAA-126_priority

Conversation

@SavioBS629
Copy link
Copy Markdown
Collaborator

@SavioBS629 SavioBS629 commented May 27, 2026

Summary

Fixes PMAA-126: test cases created via the createTestCase MCP tool always defaulted to Medium priority, regardless of what the user/agent asked for (e.g. "Critical" or "High").

Root cause

createTestCase had no priority field in its input schema (CreateTestCaseSchema) or its TestCaseCreateRequest interface. Since the request body is built directly from those params, priority was never sent to the Test Management API, so the API applied its default (Medium).

This is not a TM API contract change — the API still accepts priority on create. Verified directly:

Value sent Result
"critical" (lowercase) rejected — Invalid default field value priority
"Critical" (display name) accepted ✅

The API requires the Title-Case display name.

Changes

  • create-testcase.ts — add priority to the schema + interface, and a normalizePriority step that resolves the input to the API-accepted display name (so critical, Critical, or high all work) before sending. On form-fields lookup failure it passes the raw value through so the backend can surface its own error.
  • TCG-utils/api.ts — extract the existing default-field normalizer into a shared, exported normalizeDefaultFieldValue (sits next to fetchFormFields / projectIdentifierToId, which it depends on).
  • update-testcase.ts — dedup: replace its private local copy of the normalizer with the shared import. No behavior change.

Testing

  • New unit tests for normalizeDefaultFieldValue (case-insensitive matching, display↔internal name, no-match fallback).
  • New implementation-level tests for createTestCase: normalized priority lands in the request body, priority omitted → not sent (preserves project default), form-fields lookup failure → raw value passed through.
  • Full suite green: 178 tests pass; lint / format / tsc clean.

🤖 Generated with Claude Code

@SavioBS629 SavioBS629 changed the title Fix for PMAA-126 ticket fix: PMAA-126 ticket May 28, 2026
@ruturaj-browserstack ruturaj-browserstack merged commit 909c231 into browserstack:main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants